package cn.yitun.chat.yitunservercommonlib.exception;

import cn.yitun.chat.yituncommonmessage.ExceptionEnum;
import cn.yitun.chat.yituncommonmessage.result.AbstractResultMessage;
import cn.yitun.chat.yituncommonmessage.result.ResultMessage;

import java.util.HashMap;
import java.util.Map;

/**
 * 异常返回类
 */
public class ErrorResultMessage  extends ResultMessage {

    /**
     *
     */
    private static final long serialVersionUID = 1L;



    //----------------- 异常处理 start ----------------------
    public ErrorResultMessage error() {
        ErrorResultMessage error = new ErrorResultMessage();
        super.addError("500","异常");
        return error;
    }

    public void addError(ExceptionEnum exceptionEnum) {
        ErrorResultMessage error = new ErrorResultMessage();
        super.addError(exceptionEnum.getCode().toString(),exceptionEnum.getMsg());
    }

    //----------------- 异常处理 end ----------------------

}
